package me.imli.app.widget;

import me.imli.app.R;
import me.imli.app.util.ThemeUtil;
import android.annotation.SuppressLint;
import android.content.Context;
import android.support.v4.widget.SwipeRefreshLayout;
import android.util.AttributeSet;

public class SwipeLayout extends SwipeRefreshLayout {

	public SwipeLayout(Context context) {
		super(context);
		this.init();
	}
	public SwipeLayout(Context context, AttributeSet attrs) {
		super(context, attrs);
		this.init();
	}
	
	@SuppressLint("ResourceAsColor")
	private void init() {
		// 设置颜色
		setColorSchemeResources(R.color.swipe_scheme_color1,
								R.color.swipe_scheme_color2,
								R.color.swipe_scheme_color3,
								R.color.swipe_scheme_color4);
		// 设置圆的样式
		if (ThemeUtil.getCurTheme() == ThemeUtil.THEME_NIGHT) {
			setProgressBackgroundColor(R.color.theme_night_primary);
		}
	}
	
}
